package com.csdn;

public class Test2 {
    public static void main(String[] args) {
        Animals animals = new Animals();
        Dog dog = new Dog();
        animals.est();
        dog.est();
    }
}

class Animals{
    public void est(){
        System.out.println("动物吃东西");
    }
}

class Dog extends Animals{
    @Override
    public void est() {
        System.out.println("小狗吃狗粮");
    }
}